import 'package:flutter/material.dart';

class SocialLoginButton extends StatelessWidget {
  final String iconAsset;
  final VoidCallback onPressed;
  final double size;
  final double iconSize;
  final Color backgroundColor;

  const SocialLoginButton({
    super.key,
    required this.iconAsset,
    required this.onPressed,
    this.size = 48.0,
    this.iconSize = 48.0,
    this.backgroundColor = const Color(0xFFF5F5F5), 
  });

  @override
  Widget build(BuildContext context) {
    return Material(
      color: Colors.transparent,
      shape: const CircleBorder(), // 定义材质形状为圆形
      clipBehavior: Clip.antiAlias, // 抗锯齿裁剪
      child: InkWell(
        onTap: onPressed,
        child: Ink(
          width: size,
          height: size,
          decoration: BoxDecoration(
            color: backgroundColor,
            shape: BoxShape.circle,
          ),
          child: Center(
            child: Image.asset(
              iconAsset,
              width: iconSize,
              height: iconSize,
            ),
          ),
        ),
      ),
    );
  }
}